import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:DELL
 * Date:2024-10-13
 * Time:12:02
 */
public class Test {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int num=0;
        int sum=0;
        while(scan.hasNextInt()){
            int a= scan.nextInt();
            sum+=a;
            num++;
        }
        System.out.println("sum="+sum);
        System.out.println("avg="+sum/num);
        scan.close();
    }
    public static void main8(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入年龄");
        int age=scan.nextInt();
        System.out.println("年龄："+age);
        scan.nextLine();//注意回车
        System.out.println("请输入你的名字");
        String name=scan.nextLine();//nextLine读入一行 next是遇到空格就结束
        System.out.println("姓名："+name);
        System.out.println("请输入你的工资");
        float salary=scan.nextFloat();
        System.out.println("工资："+salary);
        scan.close();//可以认为scan是一个资源，用完关闭
    }
    public static void main6(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入你的名字");
        String name=scan.nextLine();//nextLine读入一行 next是遇到空格就结束
        System.out.println("姓名："+name);
        System.out.println("请输入年龄");
        int age=scan.nextInt();
        System.out.println("年龄："+age);
        System.out.println("请输入你的工资");
        float salary=scan.nextFloat();
        System.out.println("工资："+salary);
        scan.close();//可以认为scan是一个资源，用完关闭
    }
    public static void main5(String[] args) {
        int i=1;
        do{
            System.out.println(i);
            i++;
        }while(i<=10);
    }
    public static void main4(String[] args) {
        int j=1;
        int sum=0;
        while(j<=5){
            int n=1;
            int ret=1;
            for(n=1;n<=j;n++){
                ret*=n;
            }
            sum+=ret;
            j++;
        }
        System.out.println(sum);
    }
    public static void main3(String[] args) {
        int n=1;
        int ret=1;
        for(n=1;n<=5;n++){
            ret*=n;
        }
        System.out.println(ret);
    }
    public static void main2(String[] args) {
        int i=1;
        int sum=0;
        for(i=1;i<=100;i++){
            sum+=i;
        }
        System.out.println(sum);
    }
    public static void main1(String[] args) {
        int i=1;
        for(i=1;i<=10;i++){
            System.out.println(i);
        }
    }
}
